package com.liangdemo.web.baseEntity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 基础类
 *
 * @author Mr.Liang
 * @date 2022/4/25 11:49
 */
@Data
public class BaseEntity {

    @TableId
    private String id;

    /**
     * 逻辑删除字段
     */
    @Excel(name = "是否被删除", type = 1)
    private Integer delete;

    @Excel(name = "提交时间", exportFormat = "yyyy-MM-dd HH:mm:ss", width = 100)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @Excel(name = "修改时间", exportFormat = "yyyy-MM-dd HH:mm:ss", width = 100)
    @ExcelIgnore//用来跳过这个字段
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
